package com.hsnn.medstgmini.base.std.model;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * ViewDrug entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "view_drug")
public class ViewDrug implements java.io.Serializable {

	private String drugId;
	private String drugCode;
	private String drugName;
	private String drugNameSpel;
	private String drugNameEng;
	private String busName;
	private String formId;
	private String formName;
	private String specId;
	private String specName;
	private Integer factor;
	private String unit;
	private String prodCompId;
	private String compName;
	private String compSpelCode;
	private String materialId;
	private String materialName;
	private String approvalCode;
	private Timestamp approvalDate;
	private Short status;
	private Timestamp updDatetime;
	private String updUser;
	private String username;
	private String historyDrugCode;
	private Short mergeStatus;
	private Short drugAttr;
	private Integer drugIndex;
	private String pharId;
	private String pharName;
	private Short patternType;
	private Short drugSource;
	private Short isLowprice;
	private Short isAgriculture;
	private Short isHealthcare;
	private String drugStdCode;
	private String drugStdcdRemark;
	private String remark;
	private String compCode;

	// Constructors

	/** default constructor */
	public ViewDrug() {
	}

	/** minimal constructor */
	public ViewDrug(String drugId, String drugCode, String drugName,
			String formId, String specId, String prodCompId) {
		this.drugId = drugId;
		this.drugCode = drugCode;
		this.drugName = drugName;
		this.formId = formId;
		this.specId = specId;
		this.prodCompId = prodCompId;
	}

	/** full constructor */
	public ViewDrug(String drugId, String drugCode, String drugName,
			String drugNameSpel, String drugNameEng, String busName,
			String formId, String formName, String specId, String specName,
			Integer factor, String unit, String prodCompId, String compName,
			String materialId, String materialName, String approvalCode,
			Timestamp approvalDate, Short status, Timestamp updDatetime,
			String updUser, String username, String historyDrugCode,
			Short mergeStatus, Short drugAttr, Integer drugIndex,
			String pharId, String pharName, Short patternType,
			Short drugSource, Short isLowprice, Short isAgriculture,
			Short isHealthcare, String drugStdCode, String drugStdcdRemark,
			String remark) {
		this.drugId = drugId;
		this.drugCode = drugCode;
		this.drugName = drugName;
		this.drugNameSpel = drugNameSpel;
		this.drugNameEng = drugNameEng;
		this.busName = busName;
		this.formId = formId;
		this.formName = formName;
		this.specId = specId;
		this.specName = specName;
		this.factor = factor;
		this.unit = unit;
		this.prodCompId = prodCompId;
		this.compName = compName;
		this.materialId = materialId;
		this.materialName = materialName;
		this.approvalCode = approvalCode;
		this.approvalDate = approvalDate;
		this.status = status;
		this.updDatetime = updDatetime;
		this.updUser = updUser;
		this.username = username;
		this.historyDrugCode = historyDrugCode;
		this.mergeStatus = mergeStatus;
		this.drugAttr = drugAttr;
		this.drugIndex = drugIndex;
		this.pharId = pharId;
		this.pharName = pharName;
		this.patternType = patternType;
		this.drugSource = drugSource;
		this.isLowprice = isLowprice;
		this.isAgriculture = isAgriculture;
		this.isHealthcare = isHealthcare;
		this.drugStdCode = drugStdCode;
		this.drugStdcdRemark = drugStdcdRemark;
		this.remark = remark;
	}

	// Property accessors
	@Id
	@Column(name = "drug_id", length = 36)
	public String getDrugId() {
		return this.drugId;
	}

	public void setDrugId(String drugId) {
		this.drugId = drugId;
	}

	@Column(name = "drug_code", nullable = false, length = 100)
	public String getDrugCode() {
		return this.drugCode;
	}

	public void setDrugCode(String drugCode) {
		this.drugCode = drugCode;
	}

	@Column(name = "drug_name", nullable = false, length = 512)
	public String getDrugName() {
		return this.drugName;
	}

	public void setDrugName(String drugName) {
		this.drugName = drugName;
	}

	@Column(name = "drug_name_spel", length = 128)
	public String getDrugNameSpel() {
		return this.drugNameSpel;
	}

	public void setDrugNameSpel(String drugNameSpel) {
		this.drugNameSpel = drugNameSpel;
	}

	@Column(name = "drug_name_eng", length = 512)
	public String getDrugNameEng() {
		return this.drugNameEng;
	}

	public void setDrugNameEng(String drugNameEng) {
		this.drugNameEng = drugNameEng;
	}

	@Column(name = "bus_name", length = 256)
	public String getBusName() {
		return this.busName;
	}

	public void setBusName(String busName) {
		this.busName = busName;
	}

	@Column(name = "form_id", nullable = false, length = 36)
	public String getFormId() {
		return this.formId;
	}

	public void setFormId(String formId) {
		this.formId = formId;
	}

	@Column(name = "form_name", length = 100)
	public String getFormName() {
		return this.formName;
	}

	public void setFormName(String formName) {
		this.formName = formName;
	}

	@Column(name = "spec_id", nullable = false, length = 36)
	public String getSpecId() {
		return this.specId;
	}

	public void setSpecId(String specId) {
		this.specId = specId;
	}

	@Column(name = "spec_name", length = 100)
	public String getSpecName() {
		return this.specName;
	}

	public void setSpecName(String specName) {
		this.specName = specName;
	}

	@Column(name = "factor")
	public Integer getFactor() {
		return this.factor;
	}

	public void setFactor(Integer factor) {
		this.factor = factor;
	}

	@Column(name = "unit", length = 36)
	public String getUnit() {
		return this.unit;
	}

	public void setUnit(String unit) {
		this.unit = unit;
	}

	@Column(name = "prod_comp_id", nullable = false, length = 36)
	public String getProdCompId() {
		return this.prodCompId;
	}

	public void setProdCompId(String prodCompId) {
		this.prodCompId = prodCompId;
	}

	@Column(name = "comp_name", length = 512)
	public String getCompName() {
		return this.compName;
	}

	public void setCompName(String compName) {
		this.compName = compName;
	}

	@Column(name = "material_id", length = 36)
	public String getMaterialId() {
		return this.materialId;
	}

	public void setMaterialId(String materialId) {
		this.materialId = materialId;
	}

	@Column(name = "material_name", length = 100)
	public String getMaterialName() {
		return this.materialName;
	}

	public void setMaterialName(String materialName) {
		this.materialName = materialName;
	}

	@Column(name = "approval_code", length = 100)
	public String getApprovalCode() {
		return this.approvalCode;
	}

	public void setApprovalCode(String approvalCode) {
		this.approvalCode = approvalCode;
	}

	@Column(name = "approval_date", length = 19)
	public Timestamp getApprovalDate() {
		return this.approvalDate;
	}

	public void setApprovalDate(Timestamp approvalDate) {
		this.approvalDate = approvalDate;
	}

	@Column(name = "status")
	public Short getStatus() {
		return this.status;
	}

	public void setStatus(Short status) {
		this.status = status;
	}

	@Column(name = "upd_datetime", length = 19)
	public Timestamp getUpdDatetime() {
		return this.updDatetime;
	}

	public void setUpdDatetime(Timestamp updDatetime) {
		this.updDatetime = updDatetime;
	}

	@Column(name = "upd_user", length = 36)
	public String getUpdUser() {
		return this.updUser;
	}

	public void setUpdUser(String updUser) {
		this.updUser = updUser;
	}

	@Column(name = "username", length = 50)
	public String getUsername() {
		return this.username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@Column(name = "history_drug_code", length = 100)
	public String getHistoryDrugCode() {
		return this.historyDrugCode;
	}

	public void setHistoryDrugCode(String historyDrugCode) {
		this.historyDrugCode = historyDrugCode;
	}

	@Column(name = "merge_status")
	public Short getMergeStatus() {
		return this.mergeStatus;
	}

	public void setMergeStatus(Short mergeStatus) {
		this.mergeStatus = mergeStatus;
	}

	@Column(name = "drug_attr")
	public Short getDrugAttr() {
		return this.drugAttr;
	}

	public void setDrugAttr(Short drugAttr) {
		this.drugAttr = drugAttr;
	}

	@Column(name = "drug_index")
	public Integer getDrugIndex() {
		return this.drugIndex;
	}

	public void setDrugIndex(Integer drugIndex) {
		this.drugIndex = drugIndex;
	}

	@Column(name = "phar_id", length = 36)
	public String getPharId() {
		return this.pharId;
	}

	public void setPharId(String pharId) {
		this.pharId = pharId;
	}

	@Column(name = "phar_name")
	public String getPharName() {
		return this.pharName;
	}

	public void setPharName(String pharName) {
		this.pharName = pharName;
	}

	@Column(name = "pattern_type")
	public Short getPatternType() {
		return this.patternType;
	}

	public void setPatternType(Short patternType) {
		this.patternType = patternType;
	}

	@Column(name = "drug_source")
	public Short getDrugSource() {
		return this.drugSource;
	}

	public void setDrugSource(Short drugSource) {
		this.drugSource = drugSource;
	}

	@Column(name = "is_lowprice")
	public Short getIsLowprice() {
		return this.isLowprice;
	}

	public void setIsLowprice(Short isLowprice) {
		this.isLowprice = isLowprice;
	}

	@Column(name = "is_agriculture")
	public Short getIsAgriculture() {
		return this.isAgriculture;
	}

	public void setIsAgriculture(Short isAgriculture) {
		this.isAgriculture = isAgriculture;
	}

	@Column(name = "is_healthcare")
	public Short getIsHealthcare() {
		return this.isHealthcare;
	}

	public void setIsHealthcare(Short isHealthcare) {
		this.isHealthcare = isHealthcare;
	}

	@Column(name = "drug_std_code", length = 128)
	public String getDrugStdCode() {
		return this.drugStdCode;
	}

	public void setDrugStdCode(String drugStdCode) {
		this.drugStdCode = drugStdCode;
	}

	@Column(name = "drug_stdcd_remark", length = 1024)
	public String getDrugStdcdRemark() {
		return this.drugStdcdRemark;
	}

	public void setDrugStdcdRemark(String drugStdcdRemark) {
		this.drugStdcdRemark = drugStdcdRemark;
	}

	@Column(name = "remark", length = 4000)
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
	@Column(name = "comp_spel_code")
	public String getCompSpelCode() {
		return this.compSpelCode;
	}

	public void setCompSpelCode(String compSpelCode) {
		this.compSpelCode = compSpelCode;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((approvalCode == null) ? 0 : approvalCode.hashCode());
		result = prime * result
				+ ((approvalDate == null) ? 0 : approvalDate.hashCode());
		result = prime * result + ((busName == null) ? 0 : busName.hashCode());
		result = prime * result
				+ ((compName == null) ? 0 : compName.hashCode());
		result = prime * result
				+ ((compSpelCode == null) ? 0 : compSpelCode.hashCode());
		result = prime * result
				+ ((drugAttr == null) ? 0 : drugAttr.hashCode());
		result = prime * result
				+ ((drugCode == null) ? 0 : drugCode.hashCode());
		result = prime * result + ((drugId == null) ? 0 : drugId.hashCode());
		result = prime * result
				+ ((drugIndex == null) ? 0 : drugIndex.hashCode());
		result = prime * result
				+ ((drugName == null) ? 0 : drugName.hashCode());
		result = prime * result
				+ ((drugNameEng == null) ? 0 : drugNameEng.hashCode());
		result = prime * result
				+ ((drugNameSpel == null) ? 0 : drugNameSpel.hashCode());
		result = prime * result
				+ ((drugSource == null) ? 0 : drugSource.hashCode());
		result = prime * result
				+ ((drugStdCode == null) ? 0 : drugStdCode.hashCode());
		result = prime * result
				+ ((drugStdcdRemark == null) ? 0 : drugStdcdRemark.hashCode());
		result = prime * result + ((factor == null) ? 0 : factor.hashCode());
		result = prime * result + ((formId == null) ? 0 : formId.hashCode());
		result = prime * result
				+ ((formName == null) ? 0 : formName.hashCode());
		result = prime * result
				+ ((historyDrugCode == null) ? 0 : historyDrugCode.hashCode());
		result = prime * result
				+ ((isAgriculture == null) ? 0 : isAgriculture.hashCode());
		result = prime * result
				+ ((isHealthcare == null) ? 0 : isHealthcare.hashCode());
		result = prime * result
				+ ((isLowprice == null) ? 0 : isLowprice.hashCode());
		result = prime * result
				+ ((materialId == null) ? 0 : materialId.hashCode());
		result = prime * result
				+ ((materialName == null) ? 0 : materialName.hashCode());
		result = prime * result
				+ ((mergeStatus == null) ? 0 : mergeStatus.hashCode());
		result = prime * result
				+ ((patternType == null) ? 0 : patternType.hashCode());
		result = prime * result + ((pharId == null) ? 0 : pharId.hashCode());
		result = prime * result
				+ ((pharName == null) ? 0 : pharName.hashCode());
		result = prime * result
				+ ((prodCompId == null) ? 0 : prodCompId.hashCode());
		result = prime * result + ((remark == null) ? 0 : remark.hashCode());
		result = prime * result + ((specId == null) ? 0 : specId.hashCode());
		result = prime * result
				+ ((specName == null) ? 0 : specName.hashCode());
		result = prime * result + ((status == null) ? 0 : status.hashCode());
		result = prime * result + ((unit == null) ? 0 : unit.hashCode());
		result = prime * result
				+ ((updDatetime == null) ? 0 : updDatetime.hashCode());
		result = prime * result + ((updUser == null) ? 0 : updUser.hashCode());
		result = prime * result
				+ ((username == null) ? 0 : username.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ViewDrug other = (ViewDrug) obj;
		if (approvalCode == null) {
			if (other.approvalCode != null)
				return false;
		} else if (!approvalCode.equals(other.approvalCode))
			return false;
		if (approvalDate == null) {
			if (other.approvalDate != null)
				return false;
		} else if (!approvalDate.equals(other.approvalDate))
			return false;
		if (busName == null) {
			if (other.busName != null)
				return false;
		} else if (!busName.equals(other.busName))
			return false;
		if (compName == null) {
			if (other.compName != null)
				return false;
		} else if (!compName.equals(other.compName))
			return false;
		
		if (compSpelCode == null) {
			if (other.compSpelCode != null)
				return false;
		} else if (!compSpelCode.equals(other.compSpelCode))
			return false;
		
		if (drugAttr == null) {
			if (other.drugAttr != null)
				return false;
		} else if (!drugAttr.equals(other.drugAttr))
			return false;
		if (drugCode == null) {
			if (other.drugCode != null)
				return false;
		} else if (!drugCode.equals(other.drugCode))
			return false;
		if (drugId == null) {
			if (other.drugId != null)
				return false;
		} else if (!drugId.equals(other.drugId))
			return false;
		if (drugIndex == null) {
			if (other.drugIndex != null)
				return false;
		} else if (!drugIndex.equals(other.drugIndex))
			return false;
		if (drugName == null) {
			if (other.drugName != null)
				return false;
		} else if (!drugName.equals(other.drugName))
			return false;
		if (drugNameEng == null) {
			if (other.drugNameEng != null)
				return false;
		} else if (!drugNameEng.equals(other.drugNameEng))
			return false;
		if (drugNameSpel == null) {
			if (other.drugNameSpel != null)
				return false;
		} else if (!drugNameSpel.equals(other.drugNameSpel))
			return false;
		if (drugSource == null) {
			if (other.drugSource != null)
				return false;
		} else if (!drugSource.equals(other.drugSource))
			return false;
		if (drugStdCode == null) {
			if (other.drugStdCode != null)
				return false;
		} else if (!drugStdCode.equals(other.drugStdCode))
			return false;
		if (drugStdcdRemark == null) {
			if (other.drugStdcdRemark != null)
				return false;
		} else if (!drugStdcdRemark.equals(other.drugStdcdRemark))
			return false;
		if (factor == null) {
			if (other.factor != null)
				return false;
		} else if (!factor.equals(other.factor))
			return false;
		if (formId == null) {
			if (other.formId != null)
				return false;
		} else if (!formId.equals(other.formId))
			return false;
		if (formName == null) {
			if (other.formName != null)
				return false;
		} else if (!formName.equals(other.formName))
			return false;
		if (historyDrugCode == null) {
			if (other.historyDrugCode != null)
				return false;
		} else if (!historyDrugCode.equals(other.historyDrugCode))
			return false;
		if (isAgriculture == null) {
			if (other.isAgriculture != null)
				return false;
		} else if (!isAgriculture.equals(other.isAgriculture))
			return false;
		if (isHealthcare == null) {
			if (other.isHealthcare != null)
				return false;
		} else if (!isHealthcare.equals(other.isHealthcare))
			return false;
		if (isLowprice == null) {
			if (other.isLowprice != null)
				return false;
		} else if (!isLowprice.equals(other.isLowprice))
			return false;
		if (materialId == null) {
			if (other.materialId != null)
				return false;
		} else if (!materialId.equals(other.materialId))
			return false;
		if (materialName == null) {
			if (other.materialName != null)
				return false;
		} else if (!materialName.equals(other.materialName))
			return false;
		if (mergeStatus == null) {
			if (other.mergeStatus != null)
				return false;
		} else if (!mergeStatus.equals(other.mergeStatus))
			return false;
		if (patternType == null) {
			if (other.patternType != null)
				return false;
		} else if (!patternType.equals(other.patternType))
			return false;
		if (pharId == null) {
			if (other.pharId != null)
				return false;
		} else if (!pharId.equals(other.pharId))
			return false;
		if (pharName == null) {
			if (other.pharName != null)
				return false;
		} else if (!pharName.equals(other.pharName))
			return false;
		if (prodCompId == null) {
			if (other.prodCompId != null)
				return false;
		} else if (!prodCompId.equals(other.prodCompId))
			return false;
		if (remark == null) {
			if (other.remark != null)
				return false;
		} else if (!remark.equals(other.remark))
			return false;
		if (specId == null) {
			if (other.specId != null)
				return false;
		} else if (!specId.equals(other.specId))
			return false;
		if (specName == null) {
			if (other.specName != null)
				return false;
		} else if (!specName.equals(other.specName))
			return false;
		if (status == null) {
			if (other.status != null)
				return false;
		} else if (!status.equals(other.status))
			return false;
		if (unit == null) {
			if (other.unit != null)
				return false;
		} else if (!unit.equals(other.unit))
			return false;
		if (updDatetime == null) {
			if (other.updDatetime != null)
				return false;
		} else if (!updDatetime.equals(other.updDatetime))
			return false;
		if (updUser == null) {
			if (other.updUser != null)
				return false;
		} else if (!updUser.equals(other.updUser))
			return false;
		if (username == null) {
			if (other.username != null)
				return false;
		} else if (!username.equals(other.username))
			return false;
		return true;
	}

	@Transient
	public String getCompCode() {
		return compCode;
	}

	public void setCompCode(String compCode) {
		this.compCode = compCode;
	}
	
}